package com.adminsystem.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.adminsystem.mapper.ExamPaperQuestionMapper;
import com.adminsystem.entity.ExamPaperQuestion;
import com.adminsystem.service.IExamPaperQuestionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 考试题目Service业务层处理
 *
 * @author admin
 * @date 2023-11-23
 */
@Service
public class ExamPaperQuestionServiceImpl extends ServiceImpl<ExamPaperQuestionMapper, ExamPaperQuestion> implements IExamPaperQuestionService {
    @Autowired
    private ExamPaperQuestionMapper examPaperQuestionMapper;

    /**
     * 查询考试题目
     *
     * @param questionId 考试题目主键
     * @return 考试题目
     */
    @Override
    public ExamPaperQuestion selectExamPaperQuestionByQuestionId(Long questionId) {
        return examPaperQuestionMapper.selectExamPaperQuestionByQuestionId(questionId);
    }

    /**
     * 查询考试题目列表
     *
     * @param examPaperQuestion 考试题目
     * @return 考试题目
     */
    @Override
    public List<ExamPaperQuestion> selectExamPaperQuestionList(ExamPaperQuestion examPaperQuestion) {
        return examPaperQuestionMapper.selectExamPaperQuestionList(examPaperQuestion);
    }

    @Override
    public List<ExamPaperQuestion> selectExamPaperQuestionListByPaperId(ExamPaperQuestion examPaperQuestion) {
        return examPaperQuestionMapper.selectExamPaperQuestionListByPaperId(examPaperQuestion);
    }

    @Override
    public List<ExamPaperQuestion> selectExamPaperQuestionListExByPaperId(ExamPaperQuestion examPaperQuestion) {
        return examPaperQuestionMapper.selectExamPaperQuestionListExByPaperId(examPaperQuestion);
    }

    @Override
    public List<ExamPaperQuestion> selectExamPaperQuestionAllListByPaperId(Long paperId) {
        return examPaperQuestionMapper.selectExamPaperQuestionAllListByPaperId(paperId);
    }

    /**
     * 新增考试题目
     *
     * @param examPaperQuestion 考试题目
     * @return 结果
     */
    @Override
    public int insertExamPaperQuestion(ExamPaperQuestion examPaperQuestion) {
        examPaperQuestion.setCreateTime(DateUtils.getNowDate());
        return examPaperQuestionMapper.insertExamPaperQuestion(examPaperQuestion);
    }

    /**
     * 修改考试题目
     *
     * @param examPaperQuestion 考试题目
     * @return 结果
     */
    @Override
    public int updateExamPaperQuestion(ExamPaperQuestion examPaperQuestion) {
        examPaperQuestion.setUpdateTime(DateUtils.getNowDate());
        return examPaperQuestionMapper.updateExamPaperQuestion(examPaperQuestion);
    }

    /**
     * 批量删除考试题目
     *
     * @param questionIds 需要删除的考试题目主键
     * @return 结果
     */
    @Override
    public int deleteExamPaperQuestionByQuestionIds(Long[] questionIds) {
        return examPaperQuestionMapper.deleteExamPaperQuestionByQuestionIds(questionIds);
    }

    /**
     * 删除考试题目信息
     *
     * @param questionId 考试题目主键
     * @return 结果
     */
    @Override
    public int deleteExamPaperQuestionByQuestionId(Long questionId) {
        return examPaperQuestionMapper.deleteExamPaperQuestionByQuestionId(questionId);
    }

    @Override
    public List<ExamPaperQuestion> selectExamPaperQuestionAllList(ExamPaperQuestion examPaperQuestion) {
        return examPaperQuestionMapper.selectExamPaperQuestionAllList(examPaperQuestion);
    }

}
